import {
  createRouter,
  createWebHistory,
  createWebHashHistory,
} from "vue-router";
import index from "../views/index.vue";
import cz from "../views/cz.vue";
import zp from "../views/zp.vue";
import gws from "../views/gws.vue";
import xss from "../views/xss.vue";
import zprs from "../views/zprs.vue";
import tdjl from "../views/tdjl.vue";

import { showNotify } from "vant";
const routes = [
  {
    path: "/",
    name: "index",
    component: index,
  },
  {
    path: "/cz",
    name: "cz",
    component: cz,
  },
  {
    path: "/zp",
    name: "zp",
    component: zp,
  },
  {
    path: "/gws",
    name: "gws",
    component: gws,
  },
  {
    path: "/xss",
    name: "xss",
    component: xss,
  },
  {
    path: "/zprs",
    name: "zprs",
    component: zprs,
  },
  {
    path: "/tdjl",
    name: "tdjl",
    component: tdjl,
  }
];

const router = createRouter({
  // history: createWebHistory(process.env.BASE_URL),
  history: createWebHashHistory(),
  routes,
});

router.beforeEach(async (to: any, from: any, next: any) => {
  document.title = "高校招聘平台数据看板";
  console.log("路由", to.name);
  if (
    to.name != "about" &&
    to.name != "newpatriarchbinding" &&
    to.name != "newstudentbinding" &&
    to.name != "home"
  ) {
  }
  next();
});
router.afterEach((to: any, from: any) => { });

export default router;
